import { DialogProps } from "@/type/dialog";
import { reactive } from "vue";

export default function useDialog() {
    const dialog = reactive<DialogProps>({
        visible: false,
        title: "新增",
        width: 630,
        height: 280
    });

    const parentClose = () => {
        console.log('父组件调用关闭')
        dialog.visible = false;
    }

    const parentConfirm = () => {
        console.log('父组件调用确定')
        dialog.visible = false;
    }

    const parentShow = () => {
        console.log('父组件调用显示')
        dialog.visible = true;
    }

    return { dialog, parentShow, parentClose, parentConfirm };
}
